package com.ltmall.api.comm;

import com.ltmall.api.weixin.util.Constant;

import java.io.File;

public class Path {
    public static enum PathType {
        TOPIC_IMAGE_GET_PATH, //专题图片获取路径
        TOPIC_IMAGE_SET_PATH //专题图片发布路径
    }

    public static String projectPath = System.getProperty("catalina.base");
    public static String webappsPath = projectPath + File.separator
            + "webapps" + File.separator;
    //	115.28.57.124配置
    public static String disk = webappsPath;                                      // 磁盘
    public static String project = "HomeFlavor_Statics";                             // 项目----一级目录

    //	mac本机配置
    //	public static String disk = "/Users/vqianduan/eclipse-space/Documents/workspace/";// 磁盘
    //	public static String project = "HomeFlavor/WebRoot";// 项目----一级目录

    public static String BUSSINESS = "bussiness";                                      // 商家身份------二级目录
    public static String CLIENT = "client";                                         // 用户身份-----二级目录
    public static String PLATFORM = "platform";                                       // 平台身份------二级目录
    public static String SHOP = "shop";                                           // 商店------二级目录
    public static String GROUP = "group";                                          // 团购------二级目录

    public static String LICENCE = "licence";                                        // 执照------三级目录
    public static String HANDID = "handid";                                         // 手执身份证------三级目录
    public static String PEMISSION = "permisson";                                      // 食品流通许可证------三级目录

    public static String LOGO = "LOGO";                                           // 商店------三级目录
    public static String BRAND = "brand";                                          // 品牌------三级目录
    public static String GOODS = "goods";                                          // 商品------三级目录
    public static String GOODS_PICTURE = "picture";                                        // 商品------三级目录
    public static String STORY = "story";                                          // 故事------三级目录
    public static String BUSSINESS_ADS = "ads";                                            // 商家广告------三级目录

    public static String PHOTO = "photo";                                          // 用户头像------三级目录
    public static String HOTCITY = "hotCity";                                        // 开通的城市------三级目录
    public static String ADS = "ads";                                            // 平台广告------三级目录
    public static String SUBUNDERWRITING = "subUnderwriting";                                // 分销------三级目录

    public static String MODEL = "modelPicture";                                   // 首页模块图------三级目录

    public static String GROUP_DIRECT_SUPPLY = "directSupply";                                   // 团购_基础信息------三级目录
    public static String GROUP_BANNER = "banner";                                         // 团购_banner信息------三级目录
    public static String GROUP_PERSONAL_SETTING = "personalSetting";                                // 团购_个性化设置------三级目录

    // 实际上线的ip（请注意改这个字段,用于微信发红包接口参数！因为我根本不知道上线流程里被改了什么，所以直接加了这个属性。你们可以改掉！另外这一一页属性写的乱七八糟的是不是要整理下？）
    public static String hostIp = "115.28.57.124";
    // 实际上线域名
    public static String domain = "http://www.xiangweihui.com";
    // 微信商城地址
    public static String wechatMallHost = Constant.getWechatMallHost();

    public static String ip = Constant.getIp();
    public static String resPort = Constant.getResourcePort();
    public static String projPort = Constant.getProjectPort();

    // 商家的目录地址
    public static String nginxServerBusinessDir = ip + resPort + File.separator
            + project + File.separator + "upload"
            + File.separator + BUSSINESS
            + File.separator;
    // 用户的目录的地址
    public static String nginx_server_dir_client = ip + resPort + File.separator
            + project + File.separator + "upload"
            + File.separator + CLIENT
            + File.separator;
    // 平台的地址
    public static String nginx_server_dir_platform = ip + resPort + File.separator
            + project + File.separator + "upload"
            + File.separator + PLATFORM
            + File.separator;

    // 商品阿里支付服务器对应的url
    public static String ali_pay_notifyurl_goods = ip
            + projPort
            + "/HomeFlavor/remote/order.do?method=aliNotify";
    // 商品微信服务器对应的url
    public static String weixin_pay_notifyurl_goods = ip
            + projPort
            + "/HomeFlavor/remote/order/wxNotify.do";

    // 乡币预存-微信支付回调
    public static String weixin_pay_notifyurl_hometown_coin = ip
            + projPort
            + "/HomeFlavor/remote/wallet/wxHcNotify.do";

    // 礼品卡阿里支付服务器对应的url
    public static String ali_pay_notifyurl_giftCard = ip
            + projPort
            + "/HomeFlavor/remote/wallet.do?method=aliNotify";
    // 礼品卡微信服务器对应的url
    public static String weixin_pay_notifyurl_giftCard = ip
            + projPort
            + "/HomeFlavor/remote/wallet/wxNotify.do";

    // 疯抢阿里支付服务器对应的url
    public static String ali_pay_notifyurl_crazy = ip
            + projPort
            + "/HomeFlavor/remote/crazy.do?method=aliNotify";
    // 疯抢微信服务器对应的url
    public static String weixin_pay_notifyurl_crazy = ip
            + projPort
            + "/HomeFlavor/remote/crazy/wxNotify.do";

    public static String getPathBy(PathType type) {
        switch (type) {
            case TOPIC_IMAGE_GET_PATH:
                return nginxServerBusinessDir + GOODS + File.separator;
            case TOPIC_IMAGE_SET_PATH:
                return BUSSINESS + File.separator + GOODS;
            default:
                return "";
        }
    }
}
